package com.sjh.test.java8.joining;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class JoiningTest2 {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("1","2","3","4");
        String result=  list.stream().collect(Collectors.joining("-"));
        System.out.println(result);
    }
}
